package com.itheima.test0910.test01;

import java.time.LocalDateTime;

public class LocalDateTimeTest02 {
    public static void main(String[] args) {

        LocalDateTime birth = LocalDateTime.of(1997, 02, 14, 20,45,32);
        System.out.println(birth);
        LocalDateTime pulusYear = birth.plusYears(3);//增加年
        LocalDateTime plusMonths = birth.plusMonths(3);//增加月
        LocalDateTime plusDay = birth.plusDays(1);//增加天
        LocalDateTime plusHours = birth.plusHours(2);//增加时
        LocalDateTime plusMinutes = birth.plusMinutes(5);//增加分
        LocalDateTime plusSeconds = birth.plusSeconds(8);//增加秒


        LocalDateTime minusYears = birth.minusYears(10);//减少年
        LocalDateTime minusMonths= birth.minusMonths(1);//减少月
        LocalDateTime minusDay = birth.minusDays(1);//减少天
        LocalDateTime minusHours = birth.minusHours(2);//减少时
        LocalDateTime minusMinutes = birth.minusMinutes(5);//减少分
        LocalDateTime minusSeconds = birth.minusSeconds(8);//减少秒
    }
}
